package cc.utils;


import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;

public class Http {
	
	public static String getUrl(String u) {
		try {
			HttpGet get = new HttpGet(u);
			HttpParams params = new BasicHttpParams();
			params.setParameter(CoreProtocolPNames.USER_AGENT, "Android/RadioUniversidad.es");
			HttpClient http = new DefaultHttpClient(params);
			return EntityUtils.toString(http.execute(get).getEntity());
		} catch (Exception e) {
			return "Sin Conexión";
		}
		
	}

}
